package com.hao.chatdemo.config;

import com.corundumstudio.socketio.SocketIOClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

/**
 * TODO
 * SocketIo用于私信时候的监听器
 * @author 97472
 * @version 1.0
 * @date 2021/7/7 16:46
 */
@Component
public class SocketIoChatListener {
    // 私信的事件名
    private static final String EVENT_NAME = "chat";

    /**
     * SocketIo连接的sessionId对应者的用户id
     */
    private Map<UUID, String> sessionAndMemberIdPairs = new ConcurrentHashMap<>();

    /**
     * 用户id对应着的SocketIOClient SocketIOClient可以推送消息
     */
    private Map<String, SocketIOClient> memberIdAndClientPairs = new ConcurrentHashMap<>();


}
